function timePeriod() {
  var startTime = "6:00";
  var endTime = "5:30";
  var timeArray = [];

  // 将开始时间和结束时间转换为分钟数
  var startHour = parseInt(startTime.split(":")[0]);
  var startMinute = parseInt(startTime.split(":")[1]);
  var endHour = parseInt(endTime.split(":")[0]);
  var endMinute = parseInt(endTime.split(":")[1]);

  var currentDate = new Date();
  var startDate = new Date(
    currentDate.getFullYear(),
    currentDate.getMonth(),
    currentDate.getDate(),
    startHour,
    startMinute
  );
  var endDate = new Date(
    currentDate.getFullYear(),
    currentDate.getMonth(),
    currentDate.getDate(),
    endHour,
    endMinute
  );

  if (endDate < startDate) {
    endDate.setDate(endDate.getDate() + 1);
  }

  while (startDate <= endDate) {
    var hours = startDate.getHours().toString().padStart(2, "0");
    var minutes = startDate.getMinutes().toString().padStart(2, "0");
    timeArray.push(hours + ":" + minutes);
    startDate.setMinutes(startDate.getMinutes() + 30);
  }
  return timeArray;
}

export default timePeriod;
